SQL for Data Scientists by Renee M Teate
Author:Renee M Teate [Renée M. P. Teate]
Language: eng
Format: epub
ISBN: 9781119669395
Publisher: Wiley
Published: 2021-08-30T00:00:00+00:00
Figure 9.9
Exploring Changes Over Time
One thought that comes to mind looking at the dates during this exploration is that we should check to find out if there is an indicator in the database showing whether the market changed format, perhaps allowing online orders during the COVID-19 pandemic in 2020, since that might have impacted sales, and that indicator could be valuable for predictive modeling.
Another question we might ask the database after seeing the output in Figure 9.9 is: Do most vendors sell at the market year-round, or is there a certain time of year when there are different numbers of vendors at the farmerâs market? We'll extract the month and year from each market date and look at the counts of vendors that appear in the data each month:
SELECT EXTRACT(YEAR FROM market_date) AS market_year, EXTRACT(MONTH FROM market_date) AS market_month, COUNT(DISTINCT vendor_id) AS vendors_with_inventory FROM farmers_market5.vendor_inventory GROUP BY EXTRACT(YEAR FROM market_date), EXTRACT(MONTH FROM market_date) ORDER BY EXTRACT(YEAR FROM market_date), EXTRACT(MONTH FROM market_date)
Since only three vendors have inventory entered into this example database, there isn't much variation seen in this output, but you can see in Figure 9.10 that there are three vendors in June through September, and two vendors per month the rest of the year. So one of the vendors (likely vendor 4, from the date ranges we saw in Figure 9.9) may be a seasonal vendor.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7799)
Grails in Action by Glen Smith Peter Ledbrook(7712)
Azure Containers Explained by Wesley Haakman & Richard Hooper(6738)
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 by Chris Gill(6737)
Running Windows Containers on AWS by Marcio Morales(6252)
Kotlin in Action by Dmitry Jemerov(5080)
Microsoft 365 Identity and Services Exam Guide MS-100 by Aaron Guilmette(5004)
Combating Crime on the Dark Web by Nearchos Nearchou(4589)
Microsoft Cybersecurity Architect Exam Ref SC-100 by Dwayne Natwick(4513)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4431)
The Ruby Workshop by Akshat Paul Peter Philips Dániel Szabó and Cheyne Wallace(4267)
The Age of Surveillance Capitalism by Shoshana Zuboff(3968)
Python for Security and Networking - Third Edition by José Manuel Ortega(3834)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3522)
The Ultimate Docker Container Book by Schenker Gabriel N.;(3502)
Learn Wireshark by Lisa Bock(3423)
Mastering Python for Networking and Security by José Manuel Ortega(3368)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3343)
Blockchain Basics by Daniel Drescher(3316)
